package api

import (
	"demo/api/handler"
	"github.com/gin-gonic/gin"
)

func Router(r *gin.Engine) {
	api := r.Group("/api")
	{
		//用户
		user := api.Group("/user")
		{
			user.POST("/login", handler.Login)
		}
		//直播间
		video := api.Group("/video")
		{
			//video.Use(pkg.JWTAuth("2210a"))
			video.POST("/add", handler.AddVideo)
			video.POST("/update", handler.UpdateVideo)
			video.POST("/upload", handler.UploadVideo)
			video.GET("/list", handler.ListVideo)
			video.POST("/remove", handler.RemoveVideo)
		}

		demo := api.Group("/demo")
		{
			demo.POST("/demo", handler.ListDemo)
			demo.POST("/demoadd", handler.AddDemo)
		}
	}
}
